//群体运营
//随机找到一个家庭圈id
match (p1:Phone)-[pr:Share|PayFor]->(p2:Phone) WHERE p1.group_fam_id = p2.group_fam_id
WITH p1.group_fam_id AS comid, rand() AS r ORDER BY r LIMIT 1

//获取家庭圈详情的节点和边
MATCH group = (g1:User|LAC|Addr|Device {group_fam_id: comid})-[gr*1..2]->(g2 {group_fam_id: comid})
with  nodes(group) as nodes, relationships(group) as rels, comid

optional match vp = (u1:User{group_fam_id: comid})-[v1:visited]-(a:Addr)-[v2:visited]-(u2:User{group_fam_id: comid}) where u1 <> u2
return collect(nodes(vp))+collect(nodes) as nodes, collect(relationships(vp))+collect(rels) as rels
